﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.TcCommands.TcReplace.CCoTcReplaceBaseCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Resources;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.Ui;


namespace DnProcessSimulateCommands.TcCommands.TcReplace;

public abstract class CCoTcReplaceBaseCmd : TxButtonCommand
{
  protected bool m_dialogIsOpen;
  protected CCoTcReplaceCmdBaseEnabler m_cmdEnabler;
  private ITxValidator m_pickValidator;

  public ITxValidator PickValidator
  {
    get => this.m_pickValidator;
    set => this.m_pickValidator = value;
  }

  public virtual ITxCommandEnabler CommandEnabler => (ITxCommandEnabler) this.m_cmdEnabler;

  public virtual string Category => DnProcessSimulateCommands.StringTable.REPLACE_PROTOTYPE_CMD_CATEGORY;

  public virtual void Disconnect()
  {
    if (this.m_cmdEnabler != null)
      this.m_cmdEnabler.UnregisterFromEvents();
    base.Disconnect();
  }

  internal bool IsDialogOpen
  {
    private get => this.m_dialogIsOpen;
    set => this.m_dialogIsOpen = value;
  }

  internal ResourceManager GetResourceManager()
  {
    return new ResourceManager("DnProcessSimulateCommands.StringTable", ((object) this).GetType().Assembly);
  }

  public void DialogIsOpen(bool dialogIsOpen)
  {
    this.m_dialogIsOpen = dialogIsOpen;
    if (this.m_dialogIsOpen)
      TxApplication.ActiveUndoManager.StartTransaction();
    else
      TxApplication.ActiveUndoManager.EndTransaction();
  }
}
